
#ifndef SCRIPTPROPERTYDIALOG_H
#define SCRIPTPROPERTYDIALOG_H

#include <BScript>
#include <BLineEdit>
#include <BTreeWidget>
#include <BListWidget>
#include <BTabWidget>
#include <BDialog>

#include <BFileDialog>

using namespace BWE;

class ScriptPropertyDialog : public BDialog
{
	BOBJECT(ScriptPropertyDialog)
public:
	ScriptPropertyDialog(BWidget* parent = 0);
	~ScriptPropertyDialog();

protected:
	void applyIncludePaths();
	void applyImportPaths();
	BTreeItem* createTreeItem(BClass* cls);

protected:
	void slotAssetChanged(BObject* object, const BValue& value);

	void slotListItemClicked(BObject* object, const BValue& value);
	void slotTargetEditFinished(BObject* object, const BValue& value);
	void slotItemEditFinished(BObject* object, const BValue& value);
	void slotItemEditActived(BObject* object, const BValue& value);
	void slotBrowseButtonClicked(BObject* object, const BValue& value);

private:
	BTabWidget*				_tabWidget;
	BLineEdit*				_targetEdit;
	BLineEdit*				_pathEdit;
	BLineEdit*				_fileNameEdit;
	BListWidget*			_includePathWidget;
	BListWidget*			_importPathWidget;
	BHolder<BLineEdit>		_itemEdit;
	BButton*				_browseButton;
	BTreeWidget*			_treeWidget;

	BHolder<BFileDialog>	_fileDialog;
	BScriptHolder			_script;
};


#endif
